<template>
<view class="page-content">
</view>
</template>

<script>
export default {
  name: "result",
  data() {
    return{

    }
  },
  onShow(){
    this.getdata();
  },
  onLoad(option){
    console.log(222,option)
  },
  methods:{
    getdata(){
      uni.request({
        url: 'http://sc.dtc.zone/baiducs', //获取用户信息
        //header: {token:res0.data.data.token},
        method: 'POST',
        success: (res) => {
          console.log(res)
          if(res.data.code === 1){
            let verify_token = res.data.data.verify_token;
            let successUrl = encodeURIComponent(window.location.origin+"/#/"+'pages/success/success2?verify_token='+verify_token);
            let failedUrl = encodeURIComponent(window.location.origin+"/#/"+'pages/index/index');
            let url = `https://brain.baidu.com/face/print/?token=${verify_token}&successUrl=${successUrl}&failedUrl=${failedUrl}`
            window.location.href = url;
          }
        }
      })
    }
  }
}
</script>

<style scoped>

</style>